<template>
	<!-- withdrawalmanagement提现管理 -->
	<view class="w_wp">
		<view class="w_nav">
			<view class="w_n_item">
				<view class="w_nav_number">{{info.use_money}}</view>
				<view style="text-align: center;">总提现金额</view>
			</view>
		</view>
		<view class="w_detailed">明细</view>
		<view class="w_list">
			<view class="w_item" v-for="(item,index) in list" :key="index">
				<view class="w_info">
					<text class="clamp">{{item.title}}</text>
					<text>{{item.status}}</text>
				</view>
				<view class="w_order">
					单号：{{item.send_no}}
				</view>
				<view class="w_nickname">
					<text>提现人：{{item.realname}}</text>
					<text>{{item.createtime}}</text>
					<text class="w_number">{{item.money_send}}</text>
				</view>
			</view>
		</view>
		<view class="loading_message">
			<image v-if="isloading" src="../../static/business/loading.gif"></image>
			<view v-if="isempty">到底了~</view>
		</view>
		<view class="w_buttons">
			<view @click="$navTo('/pages/groupmenu/withdrawal')" class="w_buttons_item withdrawal_buttons">提现
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {
					use_money: 0
				},

				page: 0,
				list: [],
				isloading: false,
				isempty: false,
			}
		},
		onReachBottom() {
			this.getlist();
		},
		onLoad() {
			this.getinfo();
			this.getlist();
		},
		methods: {
			getinfo() {
				this.$axios('groupPay/main', 'POST', 'supplier').then(res => {
					if (res.data.code == 200) {
						this.info = res.data.data.info;
					}
				})
			},
			getlist() {
				this.page += 1;
				this.isloading = true;
				this.$axios('groupPay/list', 'POST', 'supplier', {
					page: this.page
				}).then(res => {
					this.isloading = false;
					if (res.data.code == 200) {
						var length = res.data.data.list.length;
						this.list = this.list.concat(res.data.data.list);
						this.isempty = length <= 0 ? true : false;
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f2f2f2;
		color: $font-color-dark;
	}

	.w_wp {
		padding-bottom: 140upx;
	}

	.w_nav {
		background-color: $base-color;
		color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 150upx;
	}

	.w_nav_number {
		font-size: 40upx;
		line-height: 60upx;
		text-align: center;
	}

	.w_n_item2 {
		padding: 0 40upx;
		font-size: 26upx;
	}

	.w_nav_number2 {
		font-size: 34upx;
	}

	.w_detailed {
		font-size: 30upx;
		padding: 20upx;
	}

	.w_item {
		background-color: #fff;
		border-radius: 10upx;
		padding: 20upx;
		margin: 0 20upx 20upx;
	}

	.w_info {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-bottom: 15upx;
	}

	.w_info text:nth-of-type(1) {
		flex: 1;
		font-weight: bold;
		padding-right: 20upx;
	}

	.w_info text:nth-of-type(2) {
		color: $base-color;
	}

	.w_nickname text {
		margin-right: 20upx;
		color: $font-color-light;
	}

	.w_nickname .w_number {
		color: #0062CC;
		font-weight: bold;
		float: right;
		margin: 0;
	}

	.loading_message image {
		display: block;
		margin: 0 auto;
		height: 60upx;
		width: 60upx;
	}

	.loading_message view {
		text-align: center;
		color: $font-color-spec;
	}

	.w_buttons {
		position: fixed;
		bottom: 30upx;
		display: flex;
		align-items: center;
		padding: 0 10upx;
		width: 100%;
	}

	.w_buttons_item {
		background-color: #f0f;
		border-radius: 40upx;
		color: #fff;
		flex: 1;
		font-size: 28upx;
		margin: 0 10upx;
		text-align: center;
		line-height: 80upx;
		letter-spacing: 3px;
	}

	.shell_buttons {
		background: linear-gradient(to right, #ffac30, #fa436a, #F56C6C);
	}

	.withdrawal_buttons {
		background: linear-gradient(to right, #EA5249, #EC694C, #EB835D);
	}
</style>
